<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <textarea name="" id="" cols="30" rows="10">
        用户注册协议
        欢迎注册为京东用户
    </textarea>
    <br>
    <button class="btn" disabled>我已阅读用户协议(5)</button>
    <script>
        // let i=1
        // setInterval(function() {
        //     i++
        //     document.write(i)
        // },1000)
        // let y=5
        // setInterval(function() {
        //     i--
        //     document.write(i)
        // },3000)
        const btn=document.querySelector('.btn')
        console.log(btn.innerHTML)
        let i=5
        setInterval(function(){
            i--
            btn.innerHTML=`我已阅读用户协议(${i})`
            if(i===0){
                clearInterval(n)
                btn.disabled=false
                btn.innerHTML='同意'
            }
        },1000)
    </script>
</body>
</html>